package com.tbit.uqbike.service.event.handler;

import com.tbit.uqbike.service.event.EventType;
import lombok.extern.slf4j.Slf4j;

/**
 * 事件处理器
 *
 *
 * @author <a href="mailto:chen.chaoxiong@tbit.com.cn">ChenChaoXiong</a>
 * @since 2024/5/16
 */
@Slf4j
public abstract class EventHandler {

    protected abstract boolean match(Object config, EventType eventType);
    public void handle(Object config, EventType eventType){
        if (match(config,eventType)){
            doHandle(config,eventType);
        }
    }

    protected abstract void doHandle(Object config, EventType eventType);
}
